class RoxyLogger:

    def __init__(self):
        """
        RoxyLogger 日志记录
        """

        self.logfile = "C:/RoxyCache/Err"

    def openfile(self, file):
        """
        设置保存到的文件
        :param file: 文件全路径
        :return:
        """

        self.logfile = file

    def log(self, type, info):
        """
        记录日志
        :param type: 日志类型
        :param info: 日志内容
        :return:
        """

        with open (self.logfile, "a") as f:
            f.write("LOG", type, info)
        print("LOG", type, info)

    def err(self, type, info):
        """
        记录报错信息
        :param type: 报错类型
        :param info: 报错内容
        :return:
        """

        with open (self.logfile, "a") as f:
            f.write("ERR", type, info)
        print("ERR", type, info)